<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath %>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>农资与农产品全程供应链物流平台-客户下单</title>
<meta name="kewywords" content="农资与农产品全程供应链物流平台"/>
<meta name="description" content="农资与农产品全程供应链物流平台"/>
<link href="css/style.css" type="text/css" rel="stylesheet"/>
<script type="text/javascript" src="js/jquery-1.9.1.js"></script>	
<script type="text/javascript" src="js/dialog/lhgdialog.js?skin=default"></script>
<script type="text/javascript">	
	$(document).ready(function(){
		// 修改订单
		$("#editBt").click(function(event){
			var selected_value = getCheckBoxValue();
		    if(selected_value.length == 0) {
		    	event.preventDefault();
				$.dialog.alert("你还没有选择任何内容");
				return false;
			} else if(selected_value.length > 1){
				event.preventDefault();
				$.dialog.alert("一次只能修改一条记录！",""); 
				return false;
			}
	    	window.location.href="order/placeOrderEdit.action?selectIds="+selected_value;
		});		
	
		// 删除订单
		$("#deleteBt").click(function(event){		    	
		    var selected_value = getCheckBoxValue();
		    if(selected_value.length == 0) {
		    	event.preventDefault();
				$.dialog.alert("你还没有选择任何内容"); 
				return;
			}
	    	$.dialog.confirm("确定要删除吗？", 
		    	function(){			    	
					window.location.href="order/placeOrderDelete.action?selectIds="+selected_value;
				}, function(){}
			);
	    });
	    
		// 取消订单	
	    $("#cancelBt").click(function(event){		    	
		    var selected_value = getCheckBoxValue();
		    if(selected_value.length == 0) {
		    	event.preventDefault();
				$.dialog.alert("你还没有选择任何内容"); 
				return;
			}
	    	$.dialog.confirm("确定要取消吗？", 
		    	function(){			    	
					window.location.href="order/placeOrderCancel.action?selectIds="+selected_value;
				}, function(){}
			);
	    });
	    // 收件
		$("#receiveBt").click(function(event){
			var selected_value = getCheckBoxValue();
		    if(selected_value.length == 0) {
		    	event.preventDefault();
				$.dialog.alert("你还没有选择任何内容");
				return false;
			} else if(selected_value.length > 1){
				event.preventDefault();
				$.dialog.alert("一次只能修改一条记录！",""); 
				return false;
			}
	    	window.location.href="order/placeOrderReceive.action?selectIds="+selected_value;
		});		
		
	});
	
	function queryPlaceOrderCheck(){
		$("#queryPlaceOrder").submit();
	}	
	
	function getCheckBoxValue(){
		var selected_value = [];    
		$("input[name='ids']:checked").each(function(){    
		 	selected_value.push($(this).val());    
		}); 		
		return selected_value;			
	}
</script>
</head>
<body>
<%@include file="top.jsp" %>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
    	<td width="187" height="37" bgcolor="#e0e0e0" class="brt bbt">
    		<div class="topleft fl">系统菜单栏</div>
    	</td>
    	<td bgcolor="#e7e7e7" class=" bbt">
	    	<div class="topleft fl">您现在的位置：<a href="#">订单管理首页</a>&nbsp;>&nbsp;<span>下单管理</span>
	    	</div>
	    </td>
	</tr>
	<tr>
	    <td width="187" height="100%" valign="top" bgcolor="#FFFFFF" class="brt">
	    	<div class="left_bk">
				<div class="menu2">
				<%@include file="order_left.jsp" %>
				</div>
			</div>
		</td>
	    <td align="left" valign="top" bgcolor="#FFFFFF">
		    <div class="content">
				<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
			        <tr>
						<td height="38" style="background:url(images/zz_tit.jpg) left top repeat-x;">
							<div class="tt_back fl">下单管理</div>
							<div class="fr"><img src="images/tit_right.jpg" alt="" width="103" height="38" /></div>
						</td>
			        </tr>
			        <tr>
						<td class="borders btn">
							<table width="100%" border="0" cellspacing="0" cellpadding="0">
								<tr>
								    <td height="41" bgcolor="#fffeee" style="border-bottom:#fee7bd solid 1px;padding-left: 20px;">
										<form action="order/placeOrder.action" method="post" id="queryPlaceOrder">		
										    <table width="800" border="0" cellspacing="0" cellpadding="0" align="left">
												<tr>
												    <td width="120" align="right">寄方姓名：</td>
												    <td width="90">
												    	<input type="text" name="order.sender" class="input_are w122" /></td>
												    <td width="120" align="right">寄方电话：</td>
												    <td width="90">
												    	<input type="text" name="order.sendertel" class="input_are w122" /></td>
												     
												    <td width="120" align="right">订单状态：</td>
												    <td width="200" class="whitetdstyle">
												        <select name="order.state" >
															<option value="">--请选择--</option>
															<option value="未收件">未收件</option>
															<option value="已收件">已收件</option>
															<option value="已入库">已入库</option>
															<option value="已出库">已出库</option>
															<option value="运输中">运输中</option>
															<option value="派件中">派件中</option>
															<option value="已完成">已完成</option>
															<option value="已取消">已取消</option>
														</select>
												    </td> 
												    <td width="307">
												    	<input type="image" type="button" onclick="queryPlaceOrderCheck()" src="images/cx.jpg" />		    
												    </td>
												</tr>
											</table>
										</form>
									</td>
								</tr>
								<tr>
								    <td align="center">
									    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
											<tr align="left">
										        <td height="42" colspan="2">
											        <input type="button" id="addBt" style="cursor: pointer;" class="buttons2" value="下 单 " 
											        	onClick="location.href='order/addOrder'" />
											        <input type="button" id="editBt" class="buttons2"   style="cursor: pointer;" value="修  改" />
											        <input type="button" class="buttons2" id="deleteBt" value="删  除" style="cursor: pointer;" />
											        	
													<input type="button" class="buttons2" id="receiveBt" value="收  件" style="cursor: pointer;" />
													<input type="button" class="buttons2" id="cancelBt" value="取消订单" style="cursor: pointer;" />
													<form action="order/addOrderManage.action" id="receiveOrder">
														<input type="hidden" id="receiveId" name="receiveId" />
													</form>
													
										        </td>
											</tr>
											<tr>
										        <td colspan="2">
										        <div style="height:350px">
											        <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#e3e3e3">
														<tr class="captit">
												            <td width="5%" height="31" align="center" valign="middle">
												            	<input type="checkbox" class="checks" /></td>
												            <td width="10%" height="31" align="center" valign="middle">订单号码</td>
												            <td width="10%" height="31" align="center" valign="middle">寄方姓名</td>
												            <td width="9%" height="31" align="center" valign="middle">寄方电话</td>
												            <td width="13%" height="31" align="center" valign="middle">公司名称</td>
												            <td width="14%" height="31" align="center" valign="middle">寄方地址</td>
												            <td width="8%" height="31" align="center" valign="middle">物品重量(kg)</td>
												            <td width="6%" height="31" align="center" valign="middle">订单状态</td>
												            <td width="13%" height="31" align="center" valign="middle">下单时间</td>            
												            <td width="12%" height="31" align="center" valign="middle">订单备注</td>
														</tr>
														<s:iterator value="orderList" id="order" >
														<tr height="26" bgcolor="#efefef">
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												            	<input type="checkbox" name="ids" value="<s:property value="#order.id"/>" />
												            </td>
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												            	<s:property value="#order.id"/></td>
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												            	<s:property value="#order.sender"/></td>
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
													            <s:property value="#order.sendertel"/>
												            </td>
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												            	<s:property value="#order.senderfirm"/></td>
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												            	<s:property value="#order.senderaddr"/></td>
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												            	<s:property value="#order.weight"/></td>
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												            	<s:property value="#order.state"/></td>
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												            	<s:date name="#order.registerdate" format="yyyy-MM-dd HH:mm:ss" /></td>
												            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF" class="wordblue">
												            	<s:property value="#order.remark"/></td>
														</tr>
														</s:iterator>
											        </table>
											        </div>
										        </td>
											</tr>
											<tr>
										        <td width="30%" height="50"></td>
										        <td width="70%">
													<table width="700" border="0" align="right" cellpadding="0" cellspacing="0">
														<tr>
															<td width="100%" >${pager.paginationModel}</td>
														</tr>
													</table>
												</td>
											</tr>
									    </table>
								    </td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
		    </div>
	    </td>
	</tr>
</table>
<div class="bottom">版权所有：安徽朗坤物联网</div>
</body>
</html>